#include <gtest/gtest.h>

// EXPECT_EQ 完整执行
TEST(ExpectAndAssertTest, Expect1) {
    EXPECT_EQ(1, 2);
    EXPECT_EQ(3, 4);
}

// ASSERT_EQ 失败后立即退出
TEST(ExpectAndAssertTest, Assert1) {
    ASSERT_EQ(1, 2);
    ASSERT_EQ(3, 4);
}

void sub_routine_expect() {
    EXPECT_EQ(1, 2);
    EXPECT_EQ(3, 4);
}

void sub_routine_assert() {
    // ASSERT_EQ 失败后立即退出函数
    {
        ASSERT_EQ(1, 2);
        ASSERT_EQ(3, 4);
    }
    ASSERT_EQ(5, 6);
    ASSERT_EQ(7, 8);
}

TEST(ExpectAndAssertTest, Expect2) {
    sub_routine_expect();
    EXPECT_EQ(5, 6);
}

TEST(ExpectAndAssertTest, Assert2) {
    sub_routine_assert();
    EXPECT_EQ(5, 6);
}